home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEfluidAttrTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  44.0 KB  |  1,305 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    July 32, 2000
  21. //
  22. //
  23. //    Procedure Name:
  24. //    AEfluidAttrTemplate
  25. //
  26. //    Description
  27. //        Creates the attribute editor controls for the fluidShape node
  28. //        and nodes derived from fluidShape
  29. //
  30. //    Input Value:
  31. //        nodeName
  32. //
  33. //    Output Value:
  34. //        None
  35. //
  36.  
  37. global proc int AEfsAssignTextureCB( string $fileAttribute,
  38.                                      string $filename,
  39.                                      string $fileType )
  40. {
  41.     setAttr $fileAttribute -type "string" $filename;
  42.  
  43.     string $currentDir = `workspace -q -dir`;
  44.     retainWorkingDirectory ($currentDir);
  45.  
  46.     return true;
  47. }
  48.  
  49. global proc AEfsTextureBrowser( string $cmd )
  50. {
  51.     string  $workspace = `workspace -q -fn`;
  52.     setWorkingDirectory $workspace "image" "textures";
  53.  
  54.     fileBrowser ($cmd, "Open", "image", 0);
  55. }
  56.  
  57.  
  58. global proc AEfluidShapeInitNew( string $dummy )
  59. {
  60.     setUITemplate -pst attributeEditorTemplate;
  61.  
  62.         rowLayout -nc 2;
  63.  
  64.             text -l "";
  65.  
  66.             button -l "Initialize"
  67.                    -c ("fluids -initialize") fluidsInitBtn;
  68.  
  69.         setParent ..;
  70.  
  71.     setUITemplate -ppt;
  72. }
  73.  
  74. global proc AEfluidShapeInitReplace( string $dummy )
  75. {
  76. }
  77.  
  78. global proc AEfluidShapeDimDynamicSim( string $nodeName ) 
  79. {
  80.     int $density = `getAttr ($nodeName + ".densityMethod")`;
  81.     int $velocity = `getAttr ($nodeName + ".velocityMethod")`;
  82.     int $temperature = `getAttr ($nodeName + ".temperatureMethod")`;
  83.     int $reaction = `getAttr ($nodeName + ".fuelMethod")`;
  84.     int $isDyn = ($density == 2) || ($velocity==2) 
  85.                 || ($temperature == 2) || ($reaction == 2);
  86.     editorTemplate -dimControl $nodeName "gravity" ($isDyn==0);
  87.     editorTemplate -dimControl $nodeName "viscosity" ($velocity != 2);
  88.     editorTemplate -dimControl $nodeName "friction" ($velocity != 2);
  89.     editorTemplate -dimControl $nodeName "velocityDamp" ($isDyn==0);
  90.     editorTemplate -dimControl $nodeName "solver" ($isDyn==0);
  91.     editorTemplate -dimControl $nodeName "gridInterpolator" ($isDyn==0);
  92.     editorTemplate -dimControl $nodeName "startFrame" ($isDyn==0);
  93.     editorTemplate -dimControl $nodeName "timeStepSize" ($isDyn==0);
  94.     editorTemplate -dimControl $nodeName "conserveMass" ($isDyn==0);
  95.     editorTemplate -dimControl $nodeName "doEmission" ($isDyn==0);
  96.     editorTemplate -dimControl $nodeName "doFields" ($isDyn==0);
  97.     editorTemplate -dimControl $nodeName "collide" ($isDyn==0);
  98. }
  99.  
  100. global proc AEfluidShapeShaderTexture( string $nodeName ) 
  101. {
  102.     int $color = `getAttr ($nodeName + ".colorTexture")`;
  103.     int $incand = `getAttr ($nodeName + ".incandTexture")`;
  104.     int $opacity = `getAttr ($nodeName + ".opacityTexture")`;
  105.     int $state = ($color == 0) && ($incand == 0) && ( $opacity == 0 );
  106.     int $value = `getAttr ($nodeName + ".textureType")`;
  107.     editorTemplate -dimControl $nodeName "colorTexGain" ($color==0);
  108.     editorTemplate -dimControl $nodeName "incandTexGain" ($incand==0);
  109.     editorTemplate -dimControl $nodeName "opacityTexGain" ($opacity==0);
  110.     editorTemplate -dimControl $nodeName "densityTexOffset" $state;
  111.     editorTemplate -dimControl $nodeName "densityTexGain" $state;
  112.     editorTemplate -dimControl $nodeName "threshold" $state;
  113.     editorTemplate -dimControl $nodeName "amplitude" $state;
  114.     editorTemplate -dimControl $nodeName "ratio" $state;
  115.     editorTemplate -dimControl $nodeName "frequencyRatio" $state;
  116.     editorTemplate -dimControl $nodeName "depthMax" $state;
  117.     editorTemplate -dimControl $nodeName "inflection" $state;
  118.     editorTemplate -dimControl $nodeName "invertTexture" $state;
  119.     editorTemplate -dimControl $nodeName "textureTime" $state;
  120.     editorTemplate -dimControl $nodeName "frequency" $state;
  121.     editorTemplate -dimControl $nodeName "textureScale" $state;
  122.     editorTemplate -dimControl $nodeName "textureOrigin" $state;
  123.     editorTemplate -dimControl $nodeName "implode" $state;
  124.     editorTemplate -dimControl $nodeName "implodeCenter" $state;
  125.     if ( $value == 0 || $value == 3) {
  126.         editorTemplate -dimControl $nodeName "billowDensity" true;
  127.         editorTemplate -dimControl $nodeName "spottyness" true;
  128.         editorTemplate -dimControl $nodeName "sizeRand" true;
  129.         editorTemplate -dimControl $nodeName "randomness" true;
  130.         editorTemplate -dimControl $nodeName "falloff" true;
  131.         editorTemplate -dimControl $nodeName "numWaves" true;
  132.     } else if ( $value == 1 ) {
  133.         editorTemplate -dimControl $nodeName "billowDensity" false;
  134.         editorTemplate -dimControl $nodeName "spottyness" false;
  135.         editorTemplate -dimControl $nodeName "sizeRand" false;
  136.         editorTemplate -dimControl $nodeName "randomness" false;
  137.         editorTemplate -dimControl $nodeName "falloff" false;
  138.         editorTemplate -dimControl $nodeName "numWaves" true;
  139.     } else {
  140.         editorTemplate -dimControl $nodeName "billowDensity" true;
  141.         editorTemplate -dimControl $nodeName "spottyness" true;
  142.         editorTemplate -dimControl $nodeName "sizeRand" true;
  143.         editorTemplate -dimControl $nodeName "randomness" true;
  144.         editorTemplate -dimControl $nodeName "falloff" true;
  145.         editorTemplate -dimControl $nodeName "numWaves" false;
  146.     } 
  147. }
  148.  
  149. global proc AEfluidShapeCoordMethod( string $nodeName ) 
  150. {
  151.     int $method = `getAttr ($nodeName + ".coordinateMethod")`;
  152.     editorTemplate -dimControl $nodeName "coordinateSpeed" ($method == 0);
  153. }
  154.  
  155. global proc AEfluidShapeVolDraw( string $nodeName ) 
  156. {
  157.     string $nodeAttr = $nodeName + ".surfaceRender";
  158.     int $sr = `getAttr $nodeAttr`;
  159.     $sd = `getAttr($nodeName + ".shadedDisplay")`;
  160.     int $volDraw = ($sr == 0) && ($sd > 0 );
  161.     editorTemplate -dimControl $nodeName "slices" ($volDraw==0);
  162. }
  163.  
  164. global proc AEfluidShapeSurfaceRender( string $fullAttrName ) 
  165. {
  166.     string    $nameBits[];
  167.     tokenize($fullAttrName, ".", $nameBits);
  168.     string    $nodeName = $nameBits[0];
  169.  
  170.     string $nodeAttr = $nodeName + ".surfaceRender";
  171.     int $sr = `getAttr $nodeAttr`;
  172.     $nodeAttr = $nodeName + ".sampleMethod";
  173.     int $sm = `getAttr $nodeAttr`;
  174.     $sd = $nodeName + ".shadedDisplay";
  175.  
  176.     editorTemplate -dimControl $nodeName "sampleMethod" ($sr != 0  );
  177.  
  178.     if( $sr == 0 ){
  179.         editorTemplate -dimControl $nodeName "contrastTolerance" ($sm < 2);
  180.         editorTemplate -dimControl $nodeName "softSurface" true;
  181.         editorTemplate -dimControl $nodeName "environment" true;
  182.         editorTemplate -dimControl $nodeName "environment_Interp" true;
  183.         editorTemplate -dimControl $nodeName "surfaceThreshold" true;
  184.         editorTemplate -dimControl $nodeName "surfaceTolerance" true;
  185.         editorTemplate -dimControl $nodeName "specularColor" true;
  186.         editorTemplate -dimControl $nodeName "cosinePower" true;
  187.         editorTemplate -dimControl $nodeName "refractiveIndex" true;
  188.     } else {
  189.         editorTemplate -dimControl $nodeName "contrastTolerance" true;
  190.         editorTemplate -dimControl $nodeName "softSurface" false;
  191.         editorTemplate -dimControl $nodeName "environment" false;
  192.         editorTemplate -dimControl $nodeName "environment_Interp" false;
  193.         editorTemplate -dimControl $nodeName "surfaceThreshold" false;
  194.         editorTemplate -dimControl $nodeName "surfaceTolerance" false;
  195.         editorTemplate -dimControl $nodeName "specularColor" false;
  196.         editorTemplate -dimControl $nodeName "cosinePower" false;
  197.         editorTemplate -dimControl $nodeName "refractiveIndex" false;
  198.     }
  199.     AEfluidShapeVolDraw( $nodeName );
  200. }
  201.  
  202. global proc AEfluidShapeShadedDisplay( string $nodeName ) 
  203. {
  204.     int $sd = `getAttr ($nodeName + ".shadedDisplay")`;
  205.     editorTemplate -dimControl $nodeName "opacityPreviewGain" ($sd < 2);
  206.     AEfluidShapeVolDraw( $nodeName );
  207. }
  208.  
  209. global proc AEfluidShapeWireframeDisplay( string $nodeName ) 
  210. {
  211.     int $wd = `getAttr ($nodeName + ".wireframeDisplay")`;
  212.     editorTemplate -dimControl $nodeName "drawSaturation" ($wd < 2);
  213. }
  214.  
  215. global proc AEfluidShapeVelocityDraw( string $nodeName ) 
  216. {
  217.     int $vd = `getAttr ($nodeName + ".velocityDraw")`;
  218.     editorTemplate -dimControl $nodeName "drawHeads" ($vd == 0);
  219.     editorTemplate -dimControl $nodeName "velocityDrawSkip" ($vd == 0);
  220.     editorTemplate -dimControl $nodeName "velocityDrawLength" ($vd == 0);
  221. }
  222.  
  223. global proc AEfluidShapeDrawSubVolume( string $nodeName ) 
  224. {
  225.     int $sv = `getAttr ($nodeName + ".drawSubVolume")`;
  226.     editorTemplate -dimControl $nodeName "subVolumeCenter" ($sv == 0);
  227.     editorTemplate -dimControl $nodeName "subVolumeSize" ($sv == 0);
  228. }
  229.  
  230. global proc AEfluidShapeSampleMethod( string $nodeName ) 
  231. {
  232.     string $nodeAttr = $nodeName + ".surfaceRender";
  233.     int $sr = `getAttr $nodeAttr`;
  234.     $nodeAttr = $nodeName + ".sampleMethod";
  235.     int $sm = `getAttr $nodeAttr`;
  236.     editorTemplate -dimControl $nodeName "contrastTolerance" (($sm < 1)||($sr != 0));
  237. }
  238.  
  239. global proc AEfluidShapeDropoffShape( string $nodeName ) 
  240. {
  241.     string $nodeAttr = $nodeName + ".dropoffShape";
  242.     int $value = `getAttr $nodeAttr`;
  243.     editorTemplate -dimControl $nodeName "edgeDropoff" ($value == 0);
  244. }
  245.  
  246.  
  247. global proc AEfluidShapeMatteOpacity( string $nodeName ) 
  248. {
  249.     string $nodeAttr = $nodeName + ".matteOpacityMode";
  250.     int $value = `getAttr $nodeAttr`;
  251.     editorTemplate -dimControl $nodeName "matteOpacity" ($value == 0);
  252. }
  253.  
  254. global proc AEfluidShapeEmissionNew( string $attr )
  255. {
  256.     string $buffer[];
  257.     tokenize $attr "." $buffer;
  258.     setUITemplate -pst attributeEditorTemplate;
  259.  
  260.         rowLayout -nc 2;
  261.  
  262.             text -l "";
  263.  
  264.             button -l "Emission Editor"
  265.                    -c ( "AEfsEmissionEditor \"" + $buffer[0] + "\"" ) fluidsEmitEditorBtn;
  266.  
  267.         setParent ..;
  268.  
  269.     setUITemplate -ppt;
  270. }
  271.  
  272. global proc AEfluidShapeEmissionReplace( string $attr )
  273. {
  274.     string $buffer[];
  275.     tokenize $attr "." $buffer;
  276.     button -e -c ("AEfsEmissionEditor \"" + $buffer[0] + "\"") fluidsEmitEditorBtn;
  277. }
  278.  
  279.  
  280. global proc AEfluidShapeHideControl( string $control )
  281. {
  282.     //
  283.     // In theory, we should just be able to unmanage the control and
  284.     // that will stop it from using up space. In practice, MEL only
  285.     // does this correctly if the control is at the end of a layout.
  286.     //
  287.     // The workaround is to shrink the control's height to 1, unmanage
  288.     // it, then set it's height back to normal.
  289.     //
  290.     int $height = `control -q -height $control`;
  291.  
  292.     control -e -height 1 $control;
  293.     control -e -manage false $control;
  294.     control -e -height $height $control;
  295. }
  296.  
  297.  
  298. //
  299. // Create two integer field groups: one having 2 int fields, and one
  300. // having 3 int fields.
  301. //
  302. global proc AEfluidShape2d3dIntFldNew( string $label, string $fullAttrName )
  303. {
  304.     string    $nameBits[];
  305.     tokenize($fullAttrName, ".", $nameBits);
  306.  
  307.     string    $nodeName = $nameBits[0];
  308.     string    $attrName = $nameBits[1];
  309.  
  310.     string    $fieldName2d = ($attrName + "2dFld");
  311.     string    $fieldName3d = ($attrName + "3dFld");
  312.  
  313.     setUITemplate -pst attributeEditorTemplate;
  314.  
  315.     intFieldGrp -l $label -numberOfFields 2 $fieldName2d;
  316.     intFieldGrp -l $label -numberOfFields 3 $fieldName3d;
  317.  
  318.     setUITemplate -ppt;
  319.  
  320.     AEfluidShape2d3dIntFldReplace($fullAttrName);
  321. }
  322.  
  323.  
  324. global proc AEfluidShapeConfirmSetResolution( string $attr,
  325.                                               string $field,
  326.                                               int $is2d )
  327. //
  328. // Description:
  329. //    The user has typed into the XYZ int fields
  330. //    to change the fluid resolution.  We might need to
  331. //    post a confirm box to give the user a chance to 
  332. //    bail if the proposed resolution is too large.
  333. //    
  334. //    $attr is the compound parent "resolution" attribute
  335. //    $field is the name of the intFieldGrp 
  336. //    $is2d indicates whether $field has two fields or three
  337. //
  338. {
  339.     int $resX = `intFieldGrp -q -v1 $field`;
  340.     int $resY = `intFieldGrp -q -v2 $field`;
  341.     int $resZ = 1;
  342.  
  343.     if( !$is2d ) {
  344.         $resZ = `intFieldGrp -q -v3 $field`;
  345.     }
  346.  
  347.     if( verifyFluidResolution( $resX, $resY, $resZ ) ) {
  348.         evalEcho( "setAttr " + $attr + " " + $resX + " " + $resY + " " + $resZ );
  349.     } else {
  350.         AEfluidShapeUpdateResolution( $attr, $field, $is2d );
  351.     }
  352. }
  353.  
  354. global proc AEfluidShapeUpdateResolution( string $attr,
  355.                                           string $field,
  356.                                           int $is2d )
  357. //
  358. // Description:
  359. //    Query the resolution attribute and stuff the current
  360. //    values into the intFieldGrp.
  361. //
  362. {
  363.     float $res[] = `getAttr $attr`;
  364.  
  365.     intFieldGrp -e -v1 $res[0] -v2 $res[1] $field;
  366.  
  367.     if( !$is2d ) {
  368.         intFieldGrp -e -v3 $res[2] $field;
  369.     }
  370. }
  371.  
  372. //
  373. // If this is a 3D fluid, then enable the 3-integer field group and connect
  374. // it to the attribute's W, H and D components.
  375. //
  376. // If this is a 2D fluid, then enable the 2-integer field group and connect
  377. // it to the attribute's W and H components.
  378. //
  379. global proc AEfluidShape2d3dIntFldReplace( string $fullAttrName )
  380. {
  381.     string    $nameBits[];
  382.     tokenize($fullAttrName, ".", $nameBits);
  383.  
  384.     string    $nodeName = $nameBits[0];
  385.     string    $attrName = $nameBits[1];
  386.  
  387.     string    $fieldName2d = ($attrName + "2dFld");
  388.     string    $fieldName3d = ($attrName + "3dFld");
  389.     string    $activeField;
  390.     string    $inactiveField;
  391.  
  392.     int        $is2d = getAttr($nodeName + ".is2d");
  393.  
  394.     if ($is2d)
  395.     {
  396.         $activeField = $fieldName2d;
  397.         $inactiveField = $fieldName3d;
  398.     }
  399.     else
  400.     {
  401.         $activeField = $fieldName3d;
  402.         $inactiveField = $fieldName2d;
  403.     }
  404.  
  405.     AEfluidShapeHideControl($inactiveField);
  406.  
  407.     intFieldGrp -e 
  408.         -manage true 
  409.         -cc ( "AEfluidShapeConfirmSetResolution " + 
  410.               $fullAttrName + " " +
  411.               $activeField + " " + $is2d )
  412.         $activeField;
  413.  
  414.     if( !$is2d ) {
  415.         intFieldGrp -e 
  416.             -v3 `getAttr ($fullAttrName + "D")`
  417.             $activeField;
  418.     }
  419.  
  420.     string $callback =     ( "AEfluidShapeUpdateResolution " + 
  421.                           $fullAttrName + " " + 
  422.                           $activeField + " " + $is2d );
  423.  
  424.     // Make sure to always use the same widget for the
  425.     // scriptJob parent, so old jobs are replaced properly;
  426.     // it doesn't matter that the widget might not be
  427.     // visible, since $fieldName2d and $fieldName3d are both
  428.     // created and destroyed together.  (Setting the parent
  429.     // to whichever widget is visible could result in an
  430.     // extra scriptJob hanging around when selecting between
  431.     // 2D and 3D fluids.
  432.     //
  433.     scriptJob 
  434.         -attributeChange $fullAttrName $callback
  435.         -parent $fieldName3d
  436.         -replacePrevious;
  437.     
  438.     AEfluidShapeUpdateResolution( $fullAttrName, $activeField, $is2d );
  439. }
  440.  
  441.  
  442. global proc AEfluidShapeHideVectorNew( string $label, string $fullAttrName )
  443. {
  444.     string    $nameBits[];
  445.     tokenize($fullAttrName, ".", $nameBits);
  446.  
  447.     string    $nodeName = $nameBits[0];
  448.     string    $attrName = $nameBits[1];
  449.  
  450.     setUITemplate -pst attributeEditorTemplate;
  451.  
  452.     attrFieldGrp -l $label -attribute $fullAttrName $attrName;
  453.  
  454.     setUITemplate -ppt;
  455.  
  456.     AEfluidShapeHideVectorReplace($fullAttrName);
  457. }
  458.  
  459.  
  460. //
  461. // If this is a 3D fluid, then hide this field.
  462. //
  463. global proc AEfluidShapeHideVectorReplace( string $fullAttrName )
  464. {
  465.     string    $nameBits[];
  466.     tokenize($fullAttrName, ".", $nameBits);
  467.  
  468.     string    $nodeName = $nameBits[0];
  469.     string    $attrName = $nameBits[1];
  470.  
  471.     int        $is2d = getAttr($nodeName + ".is2d");
  472.  
  473.     if ($is2d)
  474.         AEfluidShapeHideControl($attrName);
  475.     else
  476.         attrFieldGrp -e -attribute $fullAttrName -manage true $attrName;
  477. }
  478.  
  479.  
  480. global proc AEfluidShapeHideCheckBoxNew( string $label, string $fullAttrName )
  481. {
  482.     string    $nameBits[];
  483.     tokenize($fullAttrName, ".", $nameBits);
  484.  
  485.     string    $nodeName = $nameBits[0];
  486.     string    $attrName = $nameBits[1];
  487.  
  488.     setUITemplate -pst attributeEditorTemplate;
  489.  
  490.     checkBoxGrp -l1 $label -ncb 1 $attrName;
  491.  
  492.     setUITemplate -ppt;
  493.  
  494.     AEfluidShapeHideCheckBoxReplace($fullAttrName);
  495. }
  496.  
  497.  
  498. //
  499. // If this is a 2D fluid, then hide this field, otherwise connect it to
  500. // the specified attribute.
  501. //
  502. global proc AEfluidShapeHideCheckBoxReplace( string $fullAttrName )
  503. {
  504.     string    $nameBits[];
  505.     tokenize($fullAttrName, ".", $nameBits);
  506.  
  507.     string    $nodeName = $nameBits[0];
  508.     string    $attrName = $nameBits[1];
  509.  
  510.     int        $is2d = getAttr($nodeName + ".is2d");
  511.     if( $attrName == "heightField" ){
  512.         // this is hidden if not 2D
  513.         $is2d = !$is2d;
  514.     }
  515.     if ($is2d)
  516.         AEfluidShapeHideControl($attrName);
  517.     else
  518.     {
  519.         control -e -manage true $attrName;
  520.         connectControl -index 2 $attrName $fullAttrName;
  521.     }
  522. }
  523.  
  524.  
  525. global proc AEfluidShapeHideIntSliderNew(string $label, string $fullAttrName)
  526. {
  527.     string    $nameBits[];
  528.     tokenize($fullAttrName, ".", $nameBits);
  529.  
  530.     string    $nodeName = $nameBits[0];
  531.     string    $attrName = $nameBits[1];
  532.  
  533.     setUITemplate -pst attributeEditorTemplate;
  534.  
  535.     intSliderGrp -l $label -max 12 $attrName;
  536.  
  537.     setUITemplate -ppt;
  538.  
  539.     AEfluidShapeHideIntSliderReplace($fullAttrName);
  540. }
  541.  
  542.  
  543. //
  544. // If this is a 2D fluid, then hide this field, otherwise connect it to
  545. // the specified attribute.
  546. //
  547. global proc AEfluidShapeHideIntSliderReplace(string $fullAttrName)
  548. {
  549.     string    $nameBits[];
  550.     tokenize($fullAttrName, ".", $nameBits);
  551.  
  552.     string    $nodeName = $nameBits[0];
  553.     string    $attrName = $nameBits[1];
  554.  
  555.     int        $is2d = getAttr($nodeName + ".is2d");
  556.  
  557.     if ($is2d)
  558.         AEfluidShapeHideControl($attrName);
  559.     else
  560.     {
  561.         control -e -manage true $attrName;
  562.         connectControl $attrName $fullAttrName;
  563.     }
  564. }
  565.  
  566.  
  567. global proc AEfluidShapeImplicitNew(string $fullAttrName)
  568. {
  569.     setUITemplate -pst attributeEditorTemplate;
  570.  
  571.     frameLayout
  572.         -l Implicit -collapsable true -collapse true
  573.         AEfluidImplicitFrame;
  574.  
  575.     floatSliderGrp -l "Blobby Threshold" AEfluidBlobbyThresholdFld;
  576.  
  577.     setParent ..;
  578.  
  579.     setUITemplate -ppt;
  580.  
  581.     AEfluidShapeImplicitReplace($fullAttrName);
  582. }
  583.  
  584.  
  585. global proc AEfluidShapeImplicitReplace(string $fullAttrName)
  586. {
  587.     string    $nameBits[];
  588.     tokenize($fullAttrName, ".", $nameBits);
  589.  
  590.     string    $nodeName = $nameBits[0];
  591.     int        $is2d = getAttr($nodeName + ".is2d");
  592.  
  593.     if ($is2d)
  594.         AEfluidShapeHideControl("AEfluidImplicitFrame");
  595.     else
  596.     {
  597.         control -e -manage true AEfluidImplicitFrame;
  598.  
  599.         connectControl AEfluidBlobbyThresholdFld
  600.                     ($nodeName + ".blobbyThreshold");
  601.     }
  602. }
  603.  
  604.  
  605. global proc AEfluidShapeDepthNew(string $fullAttrName)
  606. {
  607.     string    $nameBits[];
  608.     tokenize($fullAttrName, ".", $nameBits);
  609.  
  610.     string    $nodeName = $nameBits[0];
  611.     string    $attrName = $nameBits[1];
  612.  
  613.     setUITemplate -pst attributeEditorTemplate;
  614.  
  615.     attrFieldSliderGrp -l "Depth" -attribute $fullAttrName AEfluidDepthFld;
  616.  
  617.     setUITemplate -ppt;
  618.  
  619.     AEfluidShapeDepthReplace($fullAttrName);
  620. }
  621.  
  622.  
  623.  
  624. global proc AEfluidShapeDepthReplace(string $fullAttrName)
  625. {
  626.     string    $nameBits[];
  627.     tokenize($fullAttrName, ".", $nameBits);
  628.  
  629.     string    $nodeName = $nameBits[0];
  630.     string    $attrName = $nameBits[1];
  631.  
  632.     int        $is2d = getAttr($nodeName + ".is2d");
  633.  
  634.     if ($is2d)
  635.     {
  636.         control -e -manage true AEfluidDepthFld;
  637.         attrFieldSliderGrp -e -attribute $fullAttrName AEfluidDepthFld;
  638.     }
  639.     else
  640.         AEfluidShapeHideControl("AEfluidDepthFld");
  641. }
  642.  
  643. global proc AEfluidShapeBoundaryNew( string $fullAttrName )
  644. {
  645.     string    $nameBits[];
  646.     tokenize($fullAttrName, ".", $nameBits);
  647.  
  648.     string    $nodeName = $nameBits[0];
  649.     string    $attrName = $nameBits[1];
  650.     string  $control2DName = "AEfluidShape2D" + $attrName;
  651.     string  $control3DName = "AEfluidShape3D" + $attrName;
  652.  
  653.     setUITemplate -pst attributeEditorTemplate;    
  654.  
  655.     // 2D fluids don't have all the draw modes that 3D fluids do:
  656.     // Those darned ei flags aren't editable, so we create
  657.     // two controls and swap between them
  658.      attrEnumOptionMenuGrp -attribute $fullAttrName -l "Boundary Draw" $control3DName;
  659.      attrEnumOptionMenuGrp -attribute $fullAttrName -ei  2 "Outline" -ei 3 "Full"
  660.         -ei 4 "Bounding box" -ei 5 "None" -l "Boundary Draw" $control2DName;
  661.     setUITemplate -ppt;
  662.  
  663.     AEfluidShapeBoundaryReplace $fullAttrName;
  664. }
  665.  
  666. global proc AEfluidShapeBoundaryReplace( string $fullAttrName )
  667. {
  668.     string    $nameBits[];
  669.     tokenize($fullAttrName, ".", $nameBits);
  670.  
  671.     string    $nodeName = $nameBits[0];
  672.     string    $attrName = $nameBits[1];
  673.     string  $control2DName = "AEfluidShape2D" + $attrName;
  674.     string  $control3DName = "AEfluidShape3D" + $attrName;
  675.  
  676.     int        $is2d = getAttr($nodeName + ".is2d");
  677.  
  678.     if ($is2d){
  679.         control -e -manage true $control2DName;
  680.         AEfluidShapeHideControl($control3DName);
  681.         attrEnumOptionMenuGrp -e -attribute $fullAttrName $control2DName;
  682.     }
  683.     else {
  684.         AEfluidShapeHideControl($control2DName);
  685.         control -e -manage true $control3DName;
  686.         attrEnumOptionMenuGrp -e -attribute $fullAttrName $control3DName;
  687.     }
  688.  
  689. }
  690.  
  691.  
  692. global proc AEfluidShapeAttrEnumNew( string $label,string $fullAttrName )
  693. {
  694.     string    $nameBits[];
  695.     tokenize($fullAttrName, ".", $nameBits);
  696.  
  697.     string    $nodeName = $nameBits[0];
  698.     string    $attrName = $nameBits[1];
  699.     string  $control3DName =     "AEfluidShape" + $attrName;
  700.  
  701.     setUITemplate -pst attributeEditorTemplate;    
  702.      attrEnumOptionMenuGrp -attribute $fullAttrName -l $label $control3DName;
  703.     setUITemplate -ppt;
  704.  
  705.     AEfluidShapeAttrEnumReplace $fullAttrName;
  706. }
  707.  
  708. global proc AEfluidShapeAttrEnumReplace( string $fullAttrName )
  709. {
  710.     string    $nameBits[];
  711.     tokenize($fullAttrName, ".", $nameBits);
  712.  
  713.     string    $nodeName = $nameBits[0];
  714.     string    $attrName = $nameBits[1];
  715.     string  $control3DName =     "AEfluidShape" + $attrName;
  716.  
  717.     int        $is2d = getAttr($nodeName + ".is2d");
  718.  
  719.     if ($is2d) 
  720.         AEfluidShapeHideControl($control3DName);
  721.     else {
  722.         control -e -manage true $control3DName;
  723.         attrEnumOptionMenuGrp -e -attribute $fullAttrName $control3DName;
  724.     }
  725.  
  726. }
  727.  
  728. global proc AEfluidShapeSurfaceRenderUpdate( string $fullAttrName )
  729. //
  730. // Description:
  731. //  The attribute value has changed; update the radio button display
  732. //    
  733. {
  734.     int $isSurface = `getAttr $fullAttrName`;
  735.     radioButtonGrp -e -sl ($isSurface+1) AEfluidSurfRendRadio;
  736.     AEfluidShapeSurfaceRender( $fullAttrName );
  737. }
  738.  
  739. global proc AEfluidShapeSurfaceRenderChanged( string $fullAttrName )
  740. //
  741. // Description:
  742. //  Binking on the radio button should update the attr value
  743. //    
  744. {
  745.     int $isSurfRender = `radioButtonGrp -q -sl AEfluidSurfRendRadio` == 2;
  746.     if( $isSurfRender != `getAttr $fullAttrName` ) {
  747.         evalEcho ("setAttr " + $fullAttrName + " " + $isSurfRender );
  748.     }
  749. }
  750.  
  751. global proc AEfluidShapeSurfaceRenderNew( string $fullAttrName )
  752. {
  753.     setUITemplate -pst attributeEditorTemplate;
  754.     radioButtonGrp 
  755.         -nrb 2 -l "" -l1 "Volume Render" -l2 "Surface Render" 
  756.         AEfluidSurfRendRadio;
  757.     setUITemplate -ppt ;
  758.     
  759.     AEfluidShapeSurfaceRenderReplace( $fullAttrName );
  760. }
  761.  
  762. global proc AEfluidShapeSurfaceRenderReplace( string $fullAttrName )
  763. {
  764.     radioButtonGrp -e 
  765.         -cc ( "AEfluidShapeSurfaceRenderChanged " + $fullAttrName )
  766.         AEfluidSurfRendRadio;
  767.  
  768.     scriptJob 
  769.         -attributeChange $fullAttrName ("AEfluidShapeSurfaceRenderUpdate " +
  770.                                         $fullAttrName)
  771.         -parent AEfluidSurfRendRadio
  772.         -replacePrevious;
  773.  
  774.     // This *must* be deferred because in the case when
  775.     // we're creating new widgets, executing the update
  776.     // proc right away can try to dim things that don't
  777.     // exist yet.  This wound up creating some very bizarre
  778.     // attachment behaviour, reversing the locations and 
  779.     // sizes of the map buttons and value sliders for attrs
  780.     // like tolerance, cosine power, refractive index, etc.
  781.     //
  782.     evalDeferred( "AEfluidShapeSurfaceRenderUpdate " + $fullAttrName );
  783. }
  784.  
  785. global proc AEfluidShapeCloudSurfaceUpdate( string $fullAttrName ) 
  786. //
  787. // Description:
  788. //  The attribute value has changed; update the radio button display
  789. //    
  790. {
  791.     int $isCloud = `getAttr $fullAttrName`;
  792.     radioButtonGrp -e -sl ($isCloud+1) AEfluidCloudSurfRadio;
  793. }
  794.  
  795. global proc AEfluidShapeCloudSurfaceChanged( string $fullAttrName ) 
  796. //
  797. // Description:
  798. //  Binking on the radio button should update the attr value
  799. //    
  800. {
  801.     int $isCloud = `radioButtonGrp -q -sl AEfluidCloudSurfRadio` == 2;
  802.     if( $isCloud != `getAttr $fullAttrName` ) {
  803.         evalEcho( "setAttr " + $fullAttrName + " " + $isCloud );
  804.     }
  805. }
  806.  
  807. global proc AEfluidShapeCloudSurfaceNew( string $fullAttrName )
  808. {
  809.     setUITemplate -pst attributeEditorTemplate;
  810.     radioButtonGrp 
  811.         -nrb 2 -l "" -l1 "Hard Surface" -l2 "Soft Surface" 
  812.         AEfluidCloudSurfRadio;
  813.     setUITemplate -ppt ;
  814.     
  815.     AEfluidShapeCloudSurfaceReplace( $fullAttrName );
  816. }
  817.  
  818. global proc AEfluidShapeCloudSurfaceReplace( string $fullAttrName )
  819. {
  820.     radioButtonGrp -e 
  821.         -cc ( "AEfluidShapeCloudSurfaceChanged " + $fullAttrName )
  822.         AEfluidCloudSurfRadio;
  823.  
  824.     scriptJob 
  825.         -attributeChange $fullAttrName ("AEfluidShapeCloudSurfaceUpdate " +
  826.                                         $fullAttrName)
  827.         -parent AEfluidCloudSurfRadio
  828.         -replacePrevious;
  829.  
  830.     AEfluidShapeCloudSurfaceUpdate( $fullAttrName );
  831. }
  832.  
  833. global proc AEfluidShapeUpdateDensity( string $nodeName ) 
  834. {
  835.         int        $method = getAttr($nodeName + ".densityMethod");
  836.         int        $vmethod = getAttr($nodeName + ".velocityMethod");
  837.         int $dynGrid = ($method == 2); 
  838.         int $dynVel = ($vmethod == 2);
  839.         int $grid = $dynGrid || ($method == 1); 
  840.         int $vOff =  ($method == 0);
  841.         editorTemplate -dimControl $nodeName "densityScale" $vOff;
  842.         editorTemplate -dimControl $nodeName "densityBuoyancy" (!$dynVel || $vOff);
  843.         editorTemplate -dimControl $nodeName "densityDissipation" (!$grid);
  844.         editorTemplate -dimControl $nodeName "densityDiffusion" (!$dynGrid);
  845.         editorTemplate -dimControl $nodeName "densityGradient" ($grid || $vOff);
  846.         AEfluidShapeDimDynamicSim( $nodeName ) ;
  847. }
  848.  
  849. global proc AEfluidShapeUpdateVelocity( string $nodeName ) 
  850. {
  851.         int        $method = getAttr($nodeName + ".velocityMethod");
  852.         int $dynGrid = ($method == 2); 
  853.         int $grid = $dynGrid || ($method == 1); 
  854.         int $vOff =  ($method == 0);
  855.         editorTemplate -dimControl $nodeName "velocityScale" $vOff;
  856.         editorTemplate -dimControl $nodeName "velocitySwirl" (!$dynGrid);
  857.         editorTemplate -dimControl $nodeName "velocityGradient" ($grid || $vOff);
  858.         AEfluidShapeDimDynamicSim( $nodeName ) ;
  859.         // velocity method can affect whether buoyancy and temperature turbulence apply
  860.         AEfluidShapeUpdateDensity( $nodeName ) ;
  861.         AEfluidShapeUpdateTemperature( $nodeName ) ;
  862. }
  863.  
  864. global proc AEfluidShapeUpdateTemperature( string $nodeName ) 
  865. {
  866.         int        $method = getAttr($nodeName + ".temperatureMethod");
  867.         int        $rMethod = getAttr($nodeName + ".fuelMethod");
  868.         int        $vmethod = getAttr($nodeName + ".velocityMethod");
  869.         int $dynGrid = ($method == 2); 
  870.         int $dynVel = ($vmethod == 2);
  871.         int $grid = $dynGrid || ($method == 1); 
  872.         int $vOff =  ($method == 0);
  873.         int $rOff =  ($rMethod == 0);
  874.         editorTemplate -dimControl $nodeName "temperatureScale" $vOff;
  875.         editorTemplate -dimControl $nodeName "buoyancy" (!$dynVel || $vOff);
  876.         editorTemplate -dimControl $nodeName "temperatureDissipation" (!$grid);
  877.         editorTemplate -dimControl $nodeName "temperatureDiffusion" (!$dynGrid);
  878.         editorTemplate -dimControl $nodeName "temperatureTurbulence" (!$dynVel || !$grid);
  879.         editorTemplate -dimControl $nodeName "heatReleased" (!$grid || $rOff);
  880.         editorTemplate -dimControl $nodeName "temperatureGradient" ($grid || $vOff);
  881.         AEfluidShapeDimDynamicSim( $nodeName ) ;
  882. }
  883.  
  884. global proc AEfluidShapeUpdateReaction( string $nodeName ) 
  885. {
  886.         int    $method = getAttr($nodeName + ".fuelMethod");
  887.         int $dynGrid = ($method == 2); 
  888.         // at the moment, reaction is never static, but just in case...
  889.         int $grid = $dynGrid || ($method == 1); 
  890.         int $vOff =  ($method == 0);
  891.         int    $tmethod = getAttr($nodeName + ".temperatureMethod");
  892.         int $tGrid = ($tmethod == 2) || ($tmethod == 1 );
  893.  
  894.         editorTemplate -dimControl $nodeName "fuelScale" $vOff;
  895.         editorTemplate -dimControl $nodeName "reactionSpeed" (!$grid);
  896.         editorTemplate -dimControl $nodeName "fuelIgnitionTemp" (!$grid);
  897.         editorTemplate -dimControl $nodeName "maxReactionTemp" (!$grid);
  898.         editorTemplate -dimControl $nodeName "heatReleased" (!$tGrid || $vOff);
  899.         editorTemplate -dimControl $nodeName "lightReleased" $vOff;
  900.         editorTemplate -dimControl $nodeName "lightColor" $vOff;
  901.         editorTemplate -dimControl $nodeName "fuelGradient" ($grid || $vOff);
  902.         AEfluidShapeDimDynamicSim( $nodeName ) ;
  903. }
  904.  
  905. global proc AEfluidShapeUpdateColor( string $nodeName ) 
  906. {
  907.         int    $method = getAttr($nodeName + ".colorMethod");
  908.         int        $useColor = ($method > 0);
  909.         editorTemplate -dimControl $nodeName "colorDissipation" (!$useColor);
  910.         editorTemplate -dimControl $nodeName "colorDiffusion" (!$useColor);
  911.         editorTemplate -dimControl $nodeName "color" ($useColor);
  912.         editorTemplate -dimControl $nodeName "color_Interp" ($useColor);
  913.         editorTemplate -dimControl $nodeName "colorInput" ($useColor);
  914.         editorTemplate -dimControl $nodeName "colorInputBias" ($useColor);
  915. }
  916.  
  917. global proc AEfluidShapeSelfShadow( string $nodeName ) 
  918. {
  919.         int        $shadow = getAttr($nodeName + ".selfShadowing");
  920.         editorTemplate -dimControl $nodeName "hardwareSelfShadow" (!$shadow);
  921.         editorTemplate -dimControl $nodeName "shadowOpacity" (!$shadow);
  922. }
  923. global proc AEfluidShapeRealLights( string $nodeName ) 
  924. {
  925.         int        $realLights = getAttr($nodeName + ".realLights");
  926.         editorTemplate -dimControl $nodeName "directionalLight" ($realLights);
  927. }
  928.  
  929. global proc AEfluidAttrTemplate( string $nodeName, string $nodeType )
  930. {
  931.     int $debug = 0;
  932.     editorTemplate -beginScrollLayout;
  933.  
  934.         editorTemplate -beginLayout "Container Properties" -collapse false;
  935.             editorTemplate -suppress "is2d";
  936.             editorTemplate -callCustom
  937.                 "AEfluidShape2d3dIntFldNew Resolution"
  938.                 AEfluidShape2d3dIntFldReplace
  939.                 resolution;
  940.             editorTemplate -suppress resolution;
  941.             editorTemplate -addControl -l "Size" "dimensions";
  942.                 editorTemplate -addControl "boundaryX";
  943.                 editorTemplate -addControl "boundaryY";
  944.             editorTemplate -callCustom
  945.                 "AEfluidShapeAttrEnumNew \"Boundary Z\""
  946.                 AEfluidShapeAttrEnumReplace
  947.                 boundaryZ;
  948.             editorTemplate -suppress boundaryZ;
  949.             editorTemplate -callCustom
  950.                 "AEfluidShapeHideCheckBoxNew \"Use Height Field\""
  951.                 AEfluidShapeHideCheckBoxReplace
  952.                 heightField;
  953.             editorTemplate -suppress heightField;
  954.  
  955.             editorTemplate -endLayout;
  956.  
  957.             editorTemplate -beginLayout "Contents Method" -collapse false;
  958.  
  959.             editorTemplate -addSeparator;
  960.             editorTemplate -addControl -l "Density" "densityMethod"
  961.                                             "AEfluidShapeUpdateDensity";
  962.             editorTemplate -addControl "densityGradient";
  963.             editorTemplate -addSeparator;
  964.             editorTemplate -addControl -l "Velocity" "velocityMethod" 
  965.                                             "AEfluidShapeUpdateVelocity";
  966.             editorTemplate -addControl "velocityGradient";
  967.             editorTemplate -addSeparator;
  968.             editorTemplate -addControl -l "Temperature" "temperatureMethod"
  969.                                             "AEfluidShapeUpdateTemperature";
  970.             editorTemplate -addControl "temperatureGradient";
  971.             editorTemplate -addSeparator;
  972.             editorTemplate -addControl -l "Fuel" "fuelMethod"
  973.                                             "AEfluidShapeUpdateReaction";
  974.             editorTemplate -addControl -l "Fuel Gradient" "fuelGradient";
  975.             editorTemplate -addSeparator;
  976.  
  977.             editorTemplate -addControl "colorMethod"
  978.                                             "AEfluidShapeUpdateColor";
  979.  
  980.         editorTemplate -endLayout;
  981.  
  982.         editorTemplate -beginLayout "Display" -collapse true;
  983.  
  984.             editorTemplate -addControl "shadedDisplay" "AEfluidShapeShadedDisplay";
  985.             editorTemplate -addControl "opacityPreviewGain";
  986.             editorTemplate -callCustom
  987.                 "AEfluidShapeHideIntSliderNew \"Slices per Voxel\""
  988.                 AEfluidShapeHideIntSliderReplace
  989.                 slices;
  990.             editorTemplate -addControl "voxelQuality";
  991.             editorTemplate -suppress slices;
  992.             editorTemplate -addSeparator;
  993.             editorTemplate -callCustom
  994.                 "AEfluidShapeBoundaryNew"
  995.                 AEfluidShapeBoundaryReplace
  996.                 boundaryDraw;
  997.             editorTemplate -suppress boundaryDraw;
  998.             editorTemplate -addControl "numericDisplay";
  999.             editorTemplate -addControl "wireframeDisplay" "AEfluidShapeWireframeDisplay";
  1000.  
  1001.             editorTemplate -addSeparator;
  1002.  
  1003.             editorTemplate -suppress subVolumeCenter;
  1004.             editorTemplate -suppress subVolumeSize;
  1005.             editorTemplate -suppress drawSubVolume;
  1006.  
  1007.             editorTemplate -addControl "velocityDraw" "AEfluidShapeVelocityDraw";
  1008.             editorTemplate -addControl -l "Draw Arrowheads" "drawHeads";
  1009.             editorTemplate -addControl "velocityDrawSkip";
  1010.             editorTemplate -addControl -l "Draw Length" "velocityDrawLength";
  1011.  
  1012.         editorTemplate -endLayout;
  1013.  
  1014.         editorTemplate -beginLayout "Dynamic Simulation" -collapse true;
  1015.             editorTemplate -suppress "currentTime";
  1016.             editorTemplate -addControl "gravity";
  1017.             editorTemplate -addControl "viscosity";
  1018.             editorTemplate -addControl -l "Friction" "friction";
  1019.             editorTemplate -addControl -l "Damp" "velocityDamp";
  1020.             editorTemplate -addSeparator;
  1021.             // editorTemplate -suppress "solver";
  1022.             editorTemplate -addControl "solver";
  1023.             editorTemplate -addControl "gridInterpolator";
  1024.             editorTemplate -addControl "startFrame";
  1025.  
  1026.             // this is to set the simulation step
  1027.             editorTemplate -suppress "overrideTimeStep";
  1028.             editorTemplate -addControl "simulationRateScale";
  1029.             editorTemplate -addControl -l "Disable Evaluation" "disableInteractiveEval";
  1030.  
  1031.             // This needs to be generic solver attr instead
  1032.             editorTemplate -addSeparator;
  1033.             editorTemplate -beginNoOptimize;
  1034.             editorTemplate -addControl "conserveMass";
  1035.             editorTemplate -addControl -l "Use Collisions" "collide";
  1036.             editorTemplate -addControl -l "Use Emission" "doEmission";
  1037.             editorTemplate -addControl -l "Use Fields" "doFields";
  1038.             editorTemplate -endNoOptimize;
  1039.  
  1040.             // unused dynamic attributes(add eventually??)
  1041.             editorTemplate -suppress "inheritFactor";
  1042.             editorTemplate -suppress "seed";
  1043.             editorTemplate -suppress "inputForce";
  1044.             editorTemplate -suppress "emissionFunction";
  1045.             editorTemplate -suppress "massConversion";
  1046.     
  1047.  
  1048.         editorTemplate -endLayout;
  1049.  
  1050.         editorTemplate -beginLayout "Contents Details" -collapse true;
  1051.             editorTemplate -beginLayout "Density" -collapse true;
  1052.                 editorTemplate -addControl -l "Density Scale" "densityScale";
  1053.                 editorTemplate -addControl -l "Buoyancy" "densityBuoyancy";
  1054.                 editorTemplate -addControl -l "Dissipation" "densityDissipation";
  1055.                 editorTemplate -addControl -l "Diffusion" "densityDiffusion";
  1056.             editorTemplate -endLayout;
  1057.             editorTemplate -beginLayout "Velocity " -collapse true;
  1058.                 editorTemplate -addControl "velocityScale";
  1059.                 editorTemplate -addControl -l "Swirl" "velocitySwirl";
  1060.             editorTemplate -endLayout;
  1061.             editorTemplate -beginLayout "Turbulence " -collapse true;
  1062.                 editorTemplate -addControl -l "Strength" "turbulenceStrength";
  1063.                 editorTemplate -addControl -l "Frequency" "turbulenceFrequency";
  1064.                 editorTemplate -addControl -l "Speed" "turbulenceSpeed";
  1065.                 editorTemplate -suppress "turbulenceRes";
  1066.                 editorTemplate -suppress "velocityAdvect";
  1067.                 editorTemplate -suppress "velocityProject";
  1068.             editorTemplate -endLayout;
  1069.             editorTemplate -beginLayout "Temperature" -collapse true;
  1070.                 editorTemplate -addControl -l "Temperature Scale" "temperatureScale";
  1071.                 editorTemplate -addControl -l "Buoyancy" "buoyancy";
  1072.                 editorTemplate -addControl -l "Dissipation" "temperatureDissipation";
  1073.                 editorTemplate -addControl -l "Diffusion" "temperatureDiffusion";
  1074.                 editorTemplate -addControl -l "Turbulence" "temperatureTurbulence";
  1075.             editorTemplate -endLayout;
  1076.             editorTemplate -beginLayout "Fuel" -collapse true;
  1077.                 editorTemplate -addControl -l "Fuel Scale" "fuelScale";
  1078.                 editorTemplate -addControl "reactionSpeed";
  1079.                 editorTemplate -addControl -l "Ignition Temperature" "fuelIgnitionTemp";
  1080.                  editorTemplate -addControl -l "Max Temperature" "maxReactionTemp";
  1081.                 editorTemplate -addControl -l "Heat Released" "heatReleased";
  1082.                 editorTemplate -addControl -l "Light Released" "lightReleased";
  1083.                 editorTemplate -addControl -l "Light Color" "lightColor";
  1084.             editorTemplate -endLayout;
  1085.             editorTemplate -beginLayout "Color" -collapse true;
  1086.                     editorTemplate -addControl -l "Color Dissipation" "colorDissipation";
  1087.                     editorTemplate -addControl -l "Color Diffusion" "colorDiffusion";
  1088.             editorTemplate -endLayout;
  1089.         editorTemplate -endLayout;
  1090.         editorTemplate -beginLayout "Grids Cache" -collapse true;
  1091.             editorTemplate -suppress "cacheDensity";
  1092.             editorTemplate -suppress "cacheVelocity";
  1093.             editorTemplate -suppress "cacheTemperature";
  1094.             editorTemplate -suppress "cacheReaction";
  1095.             editorTemplate -suppress "cacheColor";
  1096.             editorTemplate -suppress "cacheTextureCoordinates";
  1097.             editorTemplate -endNoOptimize;
  1098.             editorTemplate -beginNoOptimize;
  1099.             editorTemplate -addControl -l "Read Density" "loadDensity";
  1100.             editorTemplate -addControl -l "Read Velocity" "loadVelocity";
  1101.             editorTemplate -addControl -l "Read Temperature" "loadTemperature";
  1102.             editorTemplate -addControl -l "Read Fuel" "loadReaction";
  1103.             editorTemplate -addControl -l "Read Color" "loadColor";
  1104.             editorTemplate -addControl -l "Read Texture Coordinates" "loadTextureCoordinates";
  1105.             editorTemplate -endNoOptimize;
  1106.         editorTemplate -endLayout;
  1107.  
  1108.         if( $nodeType == "fluidShape" ){
  1109.             editorTemplate -beginLayout "Surface" -collapse true;
  1110.                 editorTemplate -callCustom AEfluidShapeSurfaceRenderNew
  1111.                     AEfluidShapeSurfaceRenderReplace surfaceRender;
  1112.  
  1113.                 editorTemplate -suppress "surfaceRender";
  1114.                 editorTemplate -suppress "softSurface";
  1115.  
  1116.                 editorTemplate -callCustom AEfluidShapeCloudSurfaceNew
  1117.                     AEfluidShapeCloudSurfaceReplace softSurface;
  1118.  
  1119.                 editorTemplate -addControl "surfaceThreshold";
  1120.                 editorTemplate -addControl "surfaceTolerance";
  1121.                 editorTemplate -addControl "specularColor";
  1122.                 editorTemplate -addControl "cosinePower";
  1123.                 AEaddRampControl           "environment";
  1124.                 editorTemplate -addControl "refractiveIndex";
  1125.  
  1126.             editorTemplate -endLayout;
  1127.         } else {
  1128.             editorTemplate -suppress "surfaceRender";
  1129.             editorTemplate -suppress "softSurface";
  1130.             editorTemplate -suppress "surfaceThreshold";
  1131.             editorTemplate -suppress "surfaceTolerance";
  1132.             editorTemplate -suppress "specularColor";
  1133.             editorTemplate -suppress "cosinePower";
  1134.             editorTemplate -suppress "environment";
  1135.             editorTemplate -suppress "refractiveIndex";
  1136.         }
  1137.  
  1138.         editorTemplate -beginLayout "Shading" -collapse true;
  1139.             editorTemplate -addControl "transparency";
  1140.             if( $nodeType == "fluidShape" ){
  1141.                 editorTemplate -addControl "glowIntensity";
  1142.             } else {
  1143.                 editorTemplate -suppress "glowIntensity";
  1144.             }
  1145.             editorTemplate -addSeparator;
  1146.             editorTemplate -addControl "dropoffShape" "AEfluidShapeDropoffShape";
  1147.             editorTemplate -addControl "edgeDropoff";
  1148.  
  1149.             AEaddRampControl "color";
  1150.             // editorTemplate -addControl "colorInputBias";
  1151.  
  1152.             AEaddRampControl "incandescence";
  1153.             // editorTemplate -addControl "incandescenceInputBias";
  1154.  
  1155.             AEaddRampControl "opacity";
  1156.             // editorTemplate -addControl "opacityInputBias";
  1157.  
  1158.             editorTemplate -beginLayout "Matte Opacity" -collapse true;
  1159.                 editorTemplate -addControl "matteOpacityMode" "AEfluidShapeMatteOpacity";
  1160.                 editorTemplate -addControl "matteOpacity";
  1161.             editorTemplate -endLayout;
  1162.         editorTemplate -endLayout;
  1163.  
  1164.         editorTemplate -beginLayout "Shading Quality" -collapse true;
  1165.             if( $nodeType == "fluidShape" ){
  1166.                 editorTemplate -addControl "quality";
  1167.                 editorTemplate -addControl "contrastTolerance";
  1168.                 editorTemplate -addControl "sampleMethod" "AEfluidShapeSampleMethod";
  1169.             } else {
  1170.                 editorTemplate -suppress "quality";
  1171.                 editorTemplate -suppress "contrastTolerance";
  1172.                 editorTemplate -suppress "sampleMethod";
  1173.             }
  1174.             editorTemplate -addControl "renderInterpolator";
  1175.         editorTemplate -endLayout;
  1176.  
  1177.         editorTemplate -beginLayout "Textures" -collapse true;
  1178.             editorTemplate -beginNoOptimize;
  1179.             editorTemplate -addControl -l "Texture Color" "colorTexture" "AEfluidShapeShaderTexture";
  1180.             editorTemplate -addControl -l "Texture Incandescence" "incandTexture" "AEfluidShapeShaderTexture";
  1181.             editorTemplate -addControl -l "Texture Opacity" "opacityTexture" "AEfluidShapeShaderTexture";
  1182.             editorTemplate -addControl "textureType" "AEfluidShapeShaderTexture";
  1183.             editorTemplate -endNoOptimize;
  1184.             editorTemplate -addControl -l "Coordinate Method" "coordinateMethod" "AEfluidShapeCoordMethod";
  1185.             editorTemplate -addControl "coordinateSpeed";
  1186.             editorTemplate -addSeparator;
  1187.             editorTemplate -addControl "colorTexGain";
  1188.             editorTemplate -addControl "incandTexGain";
  1189.             editorTemplate -addControl "opacityTexGain";
  1190.             editorTemplate -addSeparator;
  1191.             editorTemplate -addControl "threshold";
  1192.             editorTemplate -addControl "amplitude";
  1193.             editorTemplate -addControl "ratio";
  1194.             editorTemplate -addControl "frequencyRatio";
  1195.             editorTemplate -addControl "depthMax";
  1196.             editorTemplate -beginNoOptimize;
  1197.             editorTemplate -addControl "invertTexture";
  1198.             editorTemplate -addControl "inflection";
  1199.             editorTemplate -endNoOptimize;
  1200.             editorTemplate -addSeparator;
  1201.             editorTemplate -addControl "textureTime";
  1202.             editorTemplate -addControl "frequency";
  1203.             editorTemplate -addControl "textureScale";
  1204.             editorTemplate -addControl "textureOrigin";
  1205.             editorTemplate -addSeparator;
  1206.             editorTemplate -addControl "implode";
  1207.             editorTemplate -addControl "implodeCenter";
  1208.             editorTemplate -addSeparator;
  1209.             editorTemplate -addControl "billowDensity";
  1210.             editorTemplate -addControl "spottyness";
  1211.             editorTemplate -addControl "sizeRand";
  1212.             editorTemplate -addControl "randomness";
  1213.             editorTemplate -addControl "falloff";
  1214.             editorTemplate -addSeparator;
  1215.             editorTemplate -addControl -l "Number Of Waves" "numWaves";
  1216.         editorTemplate -endLayout;
  1217.  
  1218.         if( $nodeType == "fluidShape" ){
  1219.             editorTemplate -beginLayout "Lighting" -collapse true;
  1220.             /*
  1221.                 editorTemplate -callCustom
  1222.                     "AEfluidShapeHideCheckBoxNew \"Self Shadowing\""
  1223.                     AEfluidShapeHideCheckBoxReplace
  1224.                     selfShadowing;
  1225.                 editorTemplate -suppress selfShadowing;
  1226.             */
  1227.                 editorTemplate -addControl -l "Self Shadow" "selfShadowing" "AEfluidShapeSelfShadow";
  1228.                 editorTemplate -addControl -l "Hardware Shadow" "hardwareSelfShadow";
  1229.                 editorTemplate -addControl "shadowOpacity";
  1230.                 editorTemplate -addSeparator;
  1231.                 editorTemplate -addControl "realLights" "AEfluidShapeRealLights";
  1232.                 editorTemplate -addControl "directionalLight";
  1233.             editorTemplate -endLayout;
  1234.         } else {
  1235.                 editorTemplate -suppress selfShadowing;
  1236.                 editorTemplate -suppress hardwareSelfShadow;
  1237.                 editorTemplate -suppress shadowOpacity;
  1238.                 editorTemplate -suppress realLights;
  1239.                 editorTemplate -suppress directionalLight;
  1240.         }
  1241.         if( $nodeType != "fluidShape" ){
  1242.             // Standard texture color controls
  1243.             editorTemplate -beginLayout "Color Balance" -collapse true;
  1244.                 editorTemplate -addControl "defaultColor";
  1245.                 editorTemplate -addControl "alphaGain";
  1246.                 editorTemplate -addControl "alphaOffset";
  1247.             editorTemplate -endLayout;
  1248.         }
  1249.  
  1250.         if ( $debug ) {
  1251.             editorTemplate -beginLayout "Output" -collapse false;
  1252.             editorTemplate -endLayout;
  1253.         }
  1254.  
  1255.         // Suppress attrs not currently used or not editable
  1256.         editorTemplate -suppress "diskCache";
  1257.         editorTemplate -suppress "diskCacheIC";
  1258.         editorTemplate -suppress "objectType";
  1259.         editorTemplate -suppress "surfaceShaderDepth";
  1260.  
  1261.         // include/call base class/node attributes
  1262.         if( $nodeType == "fluidShape" ){
  1263.             AEsurfaceShapeTemplate $nodeName;
  1264.         } else {
  1265.             AEshapeTemplate $nodeName;
  1266.             editorTemplate -suppress "ignoreSelfShadowing";
  1267.             editorTemplate -suppress "controlPoints";
  1268.             editorTemplate -suppress "weights";
  1269.             editorTemplate -suppress "tweak";
  1270.             editorTemplate -suppress "relativeTweak";
  1271.             editorTemplate -suppress "currentUVSet";
  1272.             editorTemplate -suppress "uvSet";
  1273.             editorTemplate -suppress "compInstObjGroups";
  1274.             editorTemplate -suppress "smoothShading";
  1275.             editorTemplate -suppress "castsShadows";
  1276.             editorTemplate -suppress "receiveShadows";
  1277.             editorTemplate -suppress "motionBlur";
  1278.             editorTemplate -suppress "primaryVisibility";
  1279.             editorTemplate -suppress "visibleInReflections";
  1280.             editorTemplate -suppress "visibleInRefractions";
  1281.             editorTemplate -suppress "doubleSided";
  1282.             editorTemplate -suppress "opposite";
  1283.             editorTemplate -suppress "geometryAntialiasingOverride";
  1284.             editorTemplate -suppress "antialiasingLevel";
  1285.             editorTemplate -suppress "shadingSamplesOverride";
  1286.             editorTemplate -suppress "shadingSamples";
  1287.             editorTemplate -suppress "maxShadingSamples";
  1288.             editorTemplate -suppress "volumeSamplesOverride";
  1289.             editorTemplate -suppress "volumeSamples";
  1290.             editorTemplate -suppress "depthJitter";
  1291.             editorTemplate -suppress "maxVisibilitySamplesOverride";
  1292.             editorTemplate -suppress "maxVisibilitySamples";
  1293.             editorTemplate -suppress "boundingBoxScale"; 
  1294.             editorTemplate -suppress "featureDisplacement";
  1295.             editorTemplate -suppress "initialSampleRate";
  1296.             editorTemplate -suppress "extraSampleRate";
  1297.             editorTemplate -suppress "textureThreshold";
  1298.             editorTemplate -suppress "normalThreshold";
  1299.         }
  1300.  
  1301.     editorTemplate -addExtraControls;
  1302.     editorTemplate -endScrollLayout;
  1303. }
  1304.  
  1305.